package com.mku.wms_service.controller;


import com.mku.wms_service.common.Response;
import com.mku.wms_service.entity.Menu;
import com.mku.wms_service.service.IMenuService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author maoxx
 * @since 2024-11-22
 */
@RestController
@RequestMapping("/menu")
public class MenuController {

    @Autowired
    private IMenuService menuService;


    @ApiOperation(value = "获取菜单列表")
    @GetMapping("/getMenuListById/{roleId}")
    public Response<List<Menu>> getMenuListById(@PathVariable("roleId") Integer roleId){
        List<Menu> list = menuService.lambdaQuery().like(Menu::getMenuright, roleId).list();
        return Response.success(list);
    }


}
